import { createRequestTypes } from '@UTILS/reduxHelper'

export const START_PAIN_MANAGEMENT = createRequestTypes('START_PAIN_MANAGEMENT')
export const GET_MY_PAIN_MANAGEMENT = createRequestTypes('GET_MY_PAIN_MANAGEMENT')
export const GET_MANAGEMENT_TEMPLATE = createRequestTypes('GET_MANAGEMENT_TEMPLATE')
export const SET_DAILY_CONTENT_VIEWED = createRequestTypes('SET_DAILY_CONTENT_VIEWED')
export const UPDATE_PAIN_MANAGEMENT = createRequestTypes('UPDATE_PAIN_MANAGEMENT')
export const GET_MANAGEMENT_TEMPLATES = createRequestTypes('GET_MANAGEMENT_TEMPLATES')
export const GET_PAIN_MANAGEMENT_SUMMARY = createRequestTypes('GET_PAIN_MANAGEMENT_SUMMARY')
export const GET_RECOMMEND_GOODS = createRequestTypes('GET_RECOMMEND_GOODS')
export const REDUCES_PLAN_COUPON = createRequestTypes('REDUCES_PLAN_COUPON')
export const GET_EVENTS_RECOMMEND_GOODS = createRequestTypes('GET_EVENTS_RECOMMEND_GOODS')
export const GET_ALL_HOME_EVENTS = createRequestTypes('GET_ALL_HOME_EVENTS')
export const GET_EVENTS_HOME_PERSONA = createRequestTypes('GET_EVENTS_HOME_PERSONA')
export const GET_EVENTS_HOME_PAGE_SPOT = createRequestTypes('GET_EVENTS_HOME_PAGE_SPOT')
export const GET_EVENTS_HOME_PAIN_DESC = createRequestTypes('GET_EVENTS_HOME_PAIN_DESC')
export const GET_MY_EXPIRED_PAIN_MANAGEMENT_LIST = createRequestTypes('GET_MY_EXPIRED_PAIN_MANAGEMENT_LIST')
export const GET_PAIN_MANAGEMENT_RESULT = createRequestTypes('GET_PAIN_MANAGEMENT_RESULT')
export const GET_RECOMMEND_PLAN = createRequestTypes('GET_RECOMMEND_PLAN')

export default {
  dispatchStartPainManagement(payload) {
    return {
      type: START_PAIN_MANAGEMENT.REQUEST,
      payload,
    }
  },
  dispatchGetMyPainManagement(payload) {
    return {
      type: GET_MY_PAIN_MANAGEMENT.REQUEST,
      payload,
    }
  },
  dispatchSetDailyContentViewed(payload) {
    return {
      type: SET_DAILY_CONTENT_VIEWED.REQUEST,
      payload,
    }
  },
  dispatchGetManagementTemplate(payload, callBack) {
    return {
      type: GET_MANAGEMENT_TEMPLATE.REQUEST,
      payload,
      callBack
    }
  },
  dispatchUpdateManagement() {
    return {
      type: UPDATE_PAIN_MANAGEMENT.REQUEST,
    }
  },
  dispatchGetManagementTemplates(isGuide) {
    return {
      type: GET_MANAGEMENT_TEMPLATES.REQUEST,
      isGuide,
    }
  },
  dispatchGetPainManagementSummary(payload) {
    return {
      type: GET_PAIN_MANAGEMENT_SUMMARY.REQUEST,
      payload,
    }
  },
  dispatchGetRecommendGoods(tagsStr) {
    return {
      type: GET_RECOMMEND_GOODS.REQUEST,
      tagsStr,
    }
  },
  dispatchGetReducedCoupon(id) {
    return {
      type: REDUCES_PLAN_COUPON.REQUEST,
      id,
    }
  },
  dispatchGetRecommendGoodsEvents() {
    return {
      type: GET_EVENTS_RECOMMEND_GOODS.REQUEST
    }
  },
  dispatchGetHomePersonaEvents() {
    return {
      type: GET_EVENTS_HOME_PERSONA.REQUEST
    }
  },
  dispatchGetHomePageSpotEvents() {
    return {
      type: GET_EVENTS_HOME_PAGE_SPOT.REQUEST
    }
  },
  dispatchGetAllHomeEvents() {
    return {
      type: GET_ALL_HOME_EVENTS.REQUEST
    }
  },
  dispatchGetHomePainDes() {
    return {
      type: GET_EVENTS_HOME_PAIN_DESC.REQUEST
    }
  },
  dispatchGetMyExpiredPainManagementList() {
    return {
      type: GET_MY_EXPIRED_PAIN_MANAGEMENT_LIST.REQUEST,
    }
  },
  dispatchGetPainManagementResult(pId) {
    return {
      type: GET_PAIN_MANAGEMENT_RESULT.REQUEST,
      pId
    }
  },
  dispatchGetRecommendMyPainManagement() {
    return {
      type: GET_RECOMMEND_PLAN.REQUEST,
    }
  },
}
